Page({
    data: {
        showButton: false,
        guideList: [{
            image: 'http://101.34.236.253/storage/student/20211106/7d0ea0681c0d7d869f78f90e1d9121ec.png',
            title: '公告栏',
            statements: ['有你想看的一切消息']
        }, {
            image: 'http://101.34.236.253/storage/student/20211106/abb8de35146d254d13e672bc8ad09411.png',
            title: '童享希望',
            statements: ['扫二维码得希望币',  '快去援助哪些需要帮助的人吧']
        }, {
            image: 'http://101.34.236.253/storage/student/20211106/f564371cdcc8820679fb8c8987559eca.png',
            title: '获奖信息',
            statements: ['你有一份待查阅的奖品信息', '快来看看吧']
        }, {
            image: 'http://101.34.236.253/storage/student/20211106/eb9f7dab175013f0bbf68a5188e60004.png',
            title: '产品信息',
            statements: ['美味的食物等你来尝']
        }]
    },

    onLoad (options) {
        this.setWindowHeight()
    },

    onChange(e) {
        const index = e.detail.current
        this.setData({
            showButton: index === this.data.guideList.length - 1
        })
    },

    setWindowHeight() {
        const {windowHeight, safeArea} = wx.getSystemInfoSync()
        this.setData({windowHeight: windowHeight - safeArea.top - 0})
    }
});
